﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using HCMServices.DAO;
using HCMServices.DTO;
using System.Collections.Generic;

namespace HCMServices.Tests.TESTDAO
{
    /// <summary>
    /// Unit test for KeyCityDAO class
    /// </summary>
    [TestClass]
    public class TestKeyCityDAO
    {
        /// <summary>
        /// Unit test for Search() method in KeyCityDAO class
        /// </summary>
        [TestMethod]
        public void TestSearch()
        {
            string connectString = "Data Source = isostore:/Database.sdf";

            KeyCityDAO keyCityDao = new KeyCityDAO(connectString);
            List<KeyCityDTO> listKeyCityDTO = null;
            listKeyCityDTO = keyCityDao.Search("h c m");
            if (listKeyCityDTO != null && listKeyCityDTO.Count > 0 && listKeyCityDTO[0].CityId == 16 && listKeyCityDTO[0].KeyCityId == 38 && listKeyCityDTO[0].KeyCity == "h c m")
            {
                Assert.IsTrue(true);
                return;
            }

            Assert.IsFalse(true);            
        }
    }
}
